const express = require('express')
var app = express()
const allUsers = [{id:1,name:'a',age:14},{id:2,name:'b',age:16},{id:3,name:'c',age:20}]
app.get('/user/:id',(req,res)=>{
    let {id} = req.params
        let auser = allUsers.find(user=> user.id ==id)
        res.send(auser)
})

app.listen('9898',()=>{
    console.log('启动 localhost:9898');
})